<template>
  <el-table
    :data="tableData"
    border
    style="width: 100%">
    <el-table-column
      fixed
      prop="id"
      label="编号"
      width="150">
    </el-table-column>
    <el-table-column
      fixed
      prop="reportname"
      label="举报者"
      width="150">
    </el-table-column>
    <el-table-column
      prop="covername"
      label="被举报者"
      width="120">
    </el-table-column>
    <el-table-column
      prop="file"
      label="文件链接"
      width="120">
    </el-table-column>
    <el-table-column

      label="操作"
      width="240">

      <template slot-scope="scope">
        <el-button @click="show(scope.row)" type="text"  size="mini">查看文件</el-button>

        <el-button  @click="deletetrace(scope.row)"type="text" size="mini">删除记录</el-button>

        <el-button @click="deletefile(scope.row)"type="text" size="mini">删除文件</el-button>
      </template>
    </el-table-column>


  </el-table>
</template>

<script>
    export default {
        name: "reportlist",
      data(){
       return{
         tableData:[

         ]
       }
      },
      methods:{
        deletefile(){

        },
        show(){

        },
         async deletetrace(data) {
           await axios(this.ip + "report/delete?id=" + data.id)
           this.$message({
             message: '删除成功',
             type: 'success'
           });
           this.getList()
         },
       async getList(){
          var list = await axios(this.ip+"report/list")
         this.tableData=list.data
        }
      },
      mounted() {
        this.getList()
      }
    }
</script>

<style scoped>

</style>
